{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#地图的使用\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Map"
   ],
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": [
    "# 创建实例  [(),()]\n",
    "map = Map(init_opts=opts.InitOpts(width=\"1080px\", height=\"720px\"))\n",
    "# 每个省份的人数\n",
    "province_info = [\n",
    "    ('安徽省', 100),\n",
    "    ('江苏省', 80),\n",
    "    ('浙江省', 200),\n",
    "    ('山东省', 20),\n",
    "    ('江西省', 280)\n",
    "]\n",
    "map.add('各省份人数', province_info, maptype='china')  #  maptype  chine 中国地图  world 世界地图\n",
    "map.set_global_opts(\n",
    "    title_opts=opts.TitleOpts(\n",
    "        title='中国各省份人数',\n",
    "    ),\n",
    "    visualmap_opts=opts.VisualMapOpts(\n",
    "        max_= 300,\n",
    "        min_= 20,\n",
    "        is_piecewise= True,\n",
    "        split_number= 5\n",
    "    )\n",
    ")\n",
    "# 渲染地图\n",
    "map.render_notebook()"
   ],
   "id": "2964fcb61f1f407f",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "",
   "id": "34185b3730d4886c",
   "outputs": [],
   "execution_count": null
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
